<?php

/**
 * sfGuardUser filter form.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter {

    public function configure() {
        $this->widgetSchema['uname'] = new sfWidgetFormFilterInput();
        $this->validatorSchema['uname'] = new sfValidatorPass();
        unset($this['username']);
    }

    public function buildQuery(array $values) { // @FIXME
        if(!empty($values['uname'])){
            $values['username'] = $values['uname']['text'];
            unset($values['uname']);
        }
        return parent::buildQuery($values);
    }
}
